Match GtkListBox, so it's possible to use the same styles for them.
Update GtkListView and GtkGridView docs to reflect that, fix a few gtk-doc
formatting leftovers along the way.
*
* ```
* gridview
- * ├── child
+ * ├── child[.activatable]
* │
- * ├── child
+ * ├── child[.activatable]
* │
* ┊
* ╰── [rubberband]
* ```
*
- * `GtkGridView` uses a single CSS node with name gridview. Each child
- * uses a single CSS node with name child. For rubberband selection,
- * a subnode with name rubberband is used.
+ * `GtkGridView` uses a single CSS node with name `gridview`. Each child uses
+ * a single CSS node with name `child`. If the [property@Gtk.ListItem.activatable]
+ * property is set, the corresponding row will have the `.activatable` style
+ * class. For rubberband selection, a subnode with name `rubberband` is used.
*
* # Accessibility
*
self->activatable = activatable;
+ if (self->owner)
+ gtk_list_item_widget_set_activatable (self->owner, activatable);
+
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ACTIVATABLE]);
}
if (list_item->child)
gtk_list_item_widget_add_child (self, list_item->child);
+ gtk_list_item_widget_set_activatable (self, list_item->activatable);
+
if (priv->item)
g_object_notify (G_OBJECT (list_item), "item");
if (priv->position != GTK_INVALID_LIST_POSITION)
if (list_item->child)
gtk_list_item_widget_remove_child (self, list_item->child);
+ gtk_list_item_widget_set_activatable (self, FALSE);
+
if (priv->item)
g_object_notify (G_OBJECT (list_item), "item");
if (priv->position != GTK_INVALID_LIST_POSITION)
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SINGLE_CLICK_ACTIVATE]);
}
+void
+gtk_list_item_widget_set_activatable (GtkListItemWidget *self,
+ gboolean activatable)
+{
+ if (activatable)
+ gtk_widget_add_css_class (GTK_WIDGET (self), "activatable");
+ else
+ gtk_widget_remove_css_class (GTK_WIDGET (self), "activatable");
+}
+
void
gtk_list_item_widget_add_child (GtkListItemWidget *self,
GtkWidget *child)
void gtk_list_item_widget_set_single_click_activate
(GtkListItemWidget *self,
gboolean single_click_activate);
+void gtk_list_item_widget_set_activatable (GtkListItemWidget *self,
+ gboolean activatable);
void gtk_list_item_widget_add_child (GtkListItemWidget *self,
GtkWidget *child);
void gtk_list_item_widget_reorder_child (GtkListItemWidget *self,
*
* ```
* listview[.separators][.rich-list][.navigation-sidebar][.data-table]
- * ├── row
+ * ├── row[.activatable]
* │
- * ├── row
+ * ├── row[.activatable]
* │
* ┊
* ╰── [rubberband]
* ```
*
- * `GtkListView` uses a single CSS node named listview. It may carry the
- * .separators style class, when `GtkListView`:show-separators property
- * is set. Each child widget uses a single CSS node named row. For
- * rubberband selection, a node with name rubberband is used.
+ * `GtkListView` uses a single CSS node named `listview`. It may carry the
+ * `.separators` style class, when [property@Gtk.ListView:show-separators]
+ * property is set. Each child widget uses a single CSS node named `row`.
+ * If the [property@Gtk.ListItem.activatable] property is set, the
+ * corresponding row will have the `.activatable` style class. For
+ * rubberband selection, a node with name `rubberband` is used.
*
* The main listview node may also carry style classes to select
* the style of [list presentation](ListContainers.html#list-styles):